Avorion Script API Documentation

Galaxy Callbacks

Note: Callbacks have to be buffered in certain situations and won't happen immediately. When unregistering a callback during a callback, all callbacks that were buffered during the last frame may still be sent, even though they were unregistered.

callback onAllianceCreated(index)

Executed whenever a new alliance is created on the server

Parameters

index Index of the alliance that was created

callback onAllScriptValuesChanged()

Executed whenever all scripts values of the galaxy have been changed at once

callback onFactionCreated(index)

Executed whenever a new faction is created on the server

Parameters

index Index of the faction that was created

callback onPlayerCreated(index)

Executed whenever a new player is created on the server

Parameters

index Index of the player that was created

callback onRelationsChanged(indexA, indexB, relations, status, relationsBefore, statusBefore)

Executed whenever a the relations between two factions change

Parameters

indexA Index of the one faction
indexB Index of the other faction
relations The new relations between the factions
status The new relation status between the factions
relationsBefore The relations between the factions before the change, nil if none
statusBefore The relation status between the factions before the change, nil if none

callback onScriptAdded(scriptIndex, scriptPath)

Executed after a script was added to the galaxy

Parameters

scriptIndex The index of the script that was added
scriptPath The path of the old script

callback onScriptRemoved(oldScriptIndex, scriptPath)

Executed after a script was removed from the galaxy

Parameters

oldScriptIndex The old index of the script that was removed
scriptPath The path of the old script

callback onScriptValueChanged(name, value)

Executed whenever a script value of the galaxy was changed

Parameters

name The name of the value
value The new value

Overview
Home Functions Search
Search:

This is the official documentation for the scripting API of Avorion. This documentation is automatically generated and not necessarily complete. Depending on the context in which functions exist, some documentation such as descriptions, return values or variable names or types may be missing.

Work in Progress. Documentation of Avorion Version: 2.5.7 c8e4beec84f7